package com.lwp.ctable.mapper;

import com.lwp.ctable.model.Image;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author kaka
 */
@Mapper
public interface ImageMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(Image record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(Image record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    Image selectByPrimaryKey(Long id);

    List<Image> selectByUserId(@Param("userId")Long userId, @Param("start")Long start, @Param("sum")Long sum);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Image record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Image record);
}